import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Button-RaisedButton-凸起按钮',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Button-RaisedButton-凸起按钮'),
        ),
          body: Demo(),
      ),
    );
  }
}

class Demo extends StatelessWidget{

  Widget build(BuildContext context){
    return Center(
      child: Column(
          children: [
            RaisedButton(
              child: Text('RaisedButton'),
              color: Colors.green,
              colorBrightness: Brightness.dark,
              disabledTextColor: Colors.grey,
              disabledColor: Colors.grey,
              textColor: Colors.white,
              textTheme: ButtonTextTheme.normal,
              splashColor: Colors.blue,
              clipBehavior: Clip.antiAlias,
              //文字与边距
              padding: EdgeInsets.all(9),
              shape: RoundedRectangleBorder(
                side: BorderSide(
                  width: 2,
                  color: Colors.red,
                  style: BorderStyle.solid
                ),
                borderRadius: BorderRadius.only(
                  topRight: Radius.circular(5),
                  bottomRight: Radius.circular(5),
                ),
              ),
              onPressed: (){},
            ),

            RaisedButton.icon(
                onPressed: (){},
                icon: Icon(Icons.add),
                label: Text('RaisedButton.icon')
            ),
          ],
      ),
    );
  }
}